package com.bbs.manage.controller;


import com.bbs.common.QueryResult;
import com.bbs.common.ResponseResult;
import com.bbs.domain.User;
import com.bbs.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/manageLogin")
    public ResponseResult manegeLogin(@RequestBody User user){

       return userService.manageLogin(user);

    }

    @GetMapping("/findAll")
    public List<User> findAll(){
        return userService.findAll();
    }

    @GetMapping("/findPage")
    public QueryResult<User> findPage(int page,int size){

        return userService.findPage(page,size);
    }
}
